/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package rps;

import java.util.ArrayList;
import java.util.Random;
import rps.RPSEnum;

/**
 *
 * @author Valentin
 */
public class Player2 {
    
    static private String name;
    static private int score;
    static private ArrayList<RPSEnum> moves = new ArrayList<RPSEnum>();
    static private int nb = 10;
    static private int manche = -1;
    
    public Player2(String name, ArrayList<RPSEnum> moves)
    {
        this.name=name;
        this.moves=moves;
    }
    
    public Player2(String name)
    {
        this.name=name;
        for(int i=0; i<nb; i++)
        {
            Random rand = new Random();
            int valeur = rand.nextInt(3);
            switch(valeur)
            {
                case 0: this.moves.add(RPSEnum.ROCK);
                        break;
                case 1: this.moves.add(RPSEnum.PAPER);
                        break;
                case 2: this.moves.add(RPSEnum.SCISSORS);
                        break;
            }
        }
    }

    public static String getName() {
        return name;
    }

    public static int getScore() {
        return score;
    }

    public static int getNb() {
        return nb;
    }

    public static void setScore(int score) {
        Player2.score = score;
    }
    
    public RPSEnum getNextMove(){
        if(manche==nb-1){
            manche=-1;
        }
        manche++;
        return moves.get(manche);
    }
    
    
}
